package com.hopu.v1.pojo.question;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 错题本表
 * @TableName t_error_notebooks_questions
 */
@TableName(value ="t_error_notebooks_questions")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class ErrorNotebooksQuestions implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 学生ID
     */
    private String studentId;

    /**
     * 错误来源:0 刷题、1 考试、2 模拟考
     */
    private Integer errorSource;

    /**
     * 错误题目
     */
    private String errorQuestion;

    /**
     * 题目类型0:单选，1:多选，2:判断，3:主观题，4:编程题
     */
    private String questionType;

    /**
     * 学生答案
     */
    private String studentAnswer;

    /**
     * 状态：1已修正 0未修正
     */
    private Integer status;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private List<ErrorNotebookOptions> options;

    public ErrorNotebooksQuestions(String studentId, Integer errorSource, String errorQuestion, String questionType, String studentAnswer, Integer status) {
        this.studentId = studentId;
        this.errorSource = errorSource;
        this.errorQuestion = errorQuestion;
        this.questionType = questionType;
        this.studentAnswer = studentAnswer;
        this.status = status;
    }
}
